package data

import (
    "gorm.io/gorm"
)

func paginate(page, limit uint) func(db *gorm.DB) *gorm.DB {
    return func(db *gorm.DB) *gorm.DB {
        return db.Offset(int((page - 1) * limit)).Limit(int(limit))
    }
}
